import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
    history: createWebHashHistory(
        window.__MICRO_APP_BASE_ROUTE__ ? `/#${window.__MICRO_APP_BASE_ROUTE__}` : '/',
    ),
    routes: [
        {
            path: '/',
            redirect: '/gas',
        },
        {
            path: '/gas',
            name: 'Gas',
            component: () => import('@/views/Layout/index.vue'),
            meta: { title: '空气卫士' },
            redirect: '/gas/global',
            children: [
                {
                    path: 'global',
                    name: 'Global',
                    component: () => import('@/views/Gas/Global/index.vue'),
                    meta: { title: '综合态势', isHide: true },
                },
            ],
        },
        {
            path: '/enterpriseIntelligent',
            name: 'EnterpriseIntelligent',
            component: () => import('@/views/Layout/index.vue'),
            meta: { title: '企业智管服' },
            redirect: '/enterpriseIntelligent/global',
            children: [
                {
                    path: 'global',
                    name: 'EnterpriseIntelligentGlobal',
                    component: () => import('@/views/EnterpriseIntelligent/Global/index.vue'),
                    meta: { title: '综合态势', isHide: true },
                },
            ],
        },
    ],
})

export default router
